package com.shigu.wsysnatch;

import com.shigu.wsysnatch.springrun.TimerTrigger;
import com.shigu.wsysnatch.springrun.WsySnatch;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 类名：SnatchMain
 * 类路径：com.shigu.src.com.shigu.com.com.shigu.wsysnatch.SnatchMain
 * 创建者：王浩翔
 * 创建时间：2017-09-06 13:19
 * 项目：snatchwebpage
 * 描述：
 */
public class SnatchMain {

    public static void main(String[] args) {
        //如果带参数，第一个参数作为文件存放路径
        if (args.length>0) {
            WsySnatch.generateFileLocation = args[0]+"/";
        }
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-context.xml");
        TimerTrigger trigger = context.getBean(TimerTrigger.class);
        trigger.execute();
        System.out.println("抓取程序启动");
    }
}
